package org.ourgrid.broker.scheduler.extensions;

import java.io.Serializable;

public class GenericTransferHandle implements Serializable {

	
	private static final long serialVersionUID = 1L;

	
	private long id;
	private String localFileName;
	private String destinationFileName;
	private String description;
	
	public GenericTransferHandle() {}

	public GenericTransferHandle(long id, String localFileName, String destinationFileName, String description) {
		this.id = id;
		this.localFileName = localFileName;
		this.description = description;
		this.destinationFileName = destinationFileName;
	}


	public long getId() {
		return id;
	}

	public String getLocalFileName() {
		return localFileName;
	}

	public String getDescription() {
		return description;
	}

	@Override
	public int hashCode() {
		return new Long( id ).hashCode();
	}

	@Override
	public boolean equals( Object obj ) {
		if ( this == obj )
			return true;
		if ( !(obj instanceof GenericTransferHandle) )
			return false;
		final GenericTransferHandle other = (GenericTransferHandle) obj;
		if ( this.id != other.id )
			return false;
		return true;
	}

	@Override
	public String toString() {
		return String.valueOf( id );
	}
	
	protected static long randomID() {
		return (long) (Math.random() * Long.MAX_VALUE);
	}
	
	public String getOppositeID() {
		return null;
	}

	public void setId(long id) {
		this.id = id;
	}

	public void setFileName(String fileName) {
		this.localFileName = fileName;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	public String getDestinationFileName() {
		return destinationFileName;
	}
}